<template>
  <div class="range_input">
    <template v-if="name1 != null && name1 != undefined">
      <input type="number" v-model="data[name1]" placeholder="最低" />
      <span>-</span>
      <input type="number" v-model="data[name2]" placeholder="最高" />
    </template>
    <template v-else>
      <input type="number" v-model="data.one.value" placeholder="最低" />
      <span>-</span>
      <input type="number" v-model="data.two.value" placeholder="最高" />
    </template>
  </div>
</template>

<script setup>
const props = defineProps({
  data: Object,
  name1: String,
  name2: String,
})
</script>

<style lang="scss" scoped>
.range_input {
  height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0;
  justify-content: space-around;
  background-color: #fff;
  border-radius: 0;
  cursor: text;
  transition: box-shadow 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
  transform: translateZ(0);
  border: solid 1px #ebebeb;
}

.range_input input {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  outline: none;
  display: inline-block;
  height: 28px;
  line-height: 28px;
  margin: 0;
  padding: 0 4px 0 6px;
  width: 39%;
  text-align: left;
  font-size: 14px;
  color: #333;
  background-color: transparent;
}
</style>

<style>
.range_input input::placeholder {
  font-family: PingFangSC;
  font-size: 14px;
  line-height: 1.43;
  color: #b7bdc6;
}
</style>
